{literal}

<script type="text/javascript">

    $(document).ready(function(){

        $("#form_verifica").validate({

            rules: {

                datainicio: { required: true },

                datafim: { required: true },

                horainicio: { required: true},

                horafim: { required: true},

                tipo: { required: true}

            },

            messages: {

            	datainicio: { required: "Obrigatorio" },

            	datafim: { required: "Obrigatorio" },

            	horainicio: { required: "Obrigatorio" },

            	horafim: { required: "Obrigatorio" },

            	tipo: { required: "Obrigatorio" }

            },

            submitHandler: function(form) {

				jqAjaxForm(form, "div_verificar");

			}

        });

        populaSelect('unidade', '{/literal}{$_site.url}{literal}', 'unidade/select-unidade');

        $("#unidade").change(function () {

        	populaSelect('sala', '{/literal}{$_site.url}{literal}', 'sala/select-sala?codunidade='+$(this).attr("value"));

        });



        $('#datainicio').datepick({showOn: 'both'});

        $("#datainicio").mask("99/99/9999");



        $('#datafim').datepick({showOn: 'both'});

        $("#datafim").mask("99/99/9999");

        $('#horainicio').mask("99:99");
        
        $('#horafim').mask("99:99");

        /*$('#horainicio').timeEntry({

        	show24Hours: true,

        	timeSteps: [1, 0, 0],

        	useMouseWheel: true,

        	initialField: 0,

            minTime: new Date(0, 0, 0, 7, 00, 0),  

            maxTime: new Date(0, 0, 0, 22, 00, 0),

            spinnerImage: '{/literal}{$_site.url}{literal}/public/images/spinnerText.png',

            spinnerSize: [30, 20, 12],

            spinnerBigImage: '{/literal}{$_site.url}{literal}/public/images/spinnerTextBig.png',

            spinnerBigSize: [60, 40, 24]

        });*/

        /*$('#horafim').timeEntry({

        	show24Hours: true,

        	timeSteps: [1, 0, 0],

        	useMouseWheel: true,

        	initialField: 0,

            minTime: new Date(0, 0, 0, 7, 00, 0),  

            maxTime: new Date(0, 0, 0, 22, 00, 0),

            spinnerImage: '{/literal}{$_site.url}{literal}/public/images/spinnerText.png',

            spinnerSize: [30, 20, 12],

            spinnerBigImage: '{/literal}{$_site.url}{literal}/public/images/spinnerTextBig.png',

            spinnerBigSize: [60, 40, 24]

        });*/


        populaSelect("tipo", '{/literal}{$_site.url}{literal}', "tipo-sala/select-tipo-sala");

    }); //fecha $(

    

</script>

{/literal}

<form id="form_verifica" name="form_unidade" method="post" action="{$_site.url}{$acao}">

    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="mvTituloFundo">

				  <tr>

					<td>

					{if $agenda->id > 0}Editar{else}Novo{/if} Agendamento

					<input type="hidden" name="cod" value="{$banco->id}"/>

					</td>

				  </tr>

				</table>

    <table width="100%" border="0" cellspacing="0" cellpadding="0">                

                <tr>

                  <td class="contForm">

                  

                  <table width="100%" border="0" cellspacing="3" cellpadding="0">

                      <tr>

                        <td valign="top" class="fundoTituloForm">Data in&iacute;cio:</td>

                        <td class="bordaFormResp"><input name="datainicio" type="text" class="formulario" id="datainicio" value="{$banco->vhr_numero}" size="10"/></td>

                        <td valign="top" class="fundoTituloForm">Data fim:</td>

                        <td class="bordaFormResp"><input name="datafim" type="text" class="formulario" id="datafim" value="{$banco->vhr_numero}" size="10"/></td>

                      </tr>

                      <tr>

                        <td valign="top" class="fundoTituloForm">Hora in&iacute;cio:</td>

                        <td class="bordaFormResp"><input name="horainicio" type="text" class="formulario" id="horainicio" value="{$banco->vhr_numero}" size="10"/></td>

                        <td valign="top" class="fundoTituloForm">Hora fim:</td>

                        <td class="bordaFormResp"><input name="horafim" type="text" class="formulario" id="horafim" value="{$banco->vhr_numero}" size="10"/></td>

                      </tr>

                      <tr>

                        <td valign="top" class="fundoTituloForm">Tipo de sala:</td>

                        <td class="bordaFormResp" colspan="3"><select name="tipo" id="tipo" class="formulario"></select></td>

                      </tr>

                      <tr>

                        <td colspan="4" class="bordaFormResp" align="center">

                          <input type="submit" value="Verificar" class="botao">

                        </td>

                      </tr>

                  </table>

                  

                  </td>

                </tr>

        

              </table>	

    </form>

    <div id="div_verificar"></div>

